package rmiClient;
import java.io.IOException;
import java.rmi.RemoteException;

import Interface.*;
import promotion.PromotionBLService;
import purchase.PurchaseBLService;
import purchase.Sales;
import purchase.SalesLineItem;
import user.userBLService;

import manage.ManageBLService;

import book.bookBLService;

public class rmiClient {
	bookInterface bi;
	ManageInterface mi;
	promotionInterface pi;
	PurchaseBLServiceInterface pbi;
	SalesInterface si;
	SalesLineItemInterface sii;
	userInterface ui;
	//String str = "rmi://localhost:8888/";
	   
	
	   public rmiClient () {
		   try {
			   bi=new bookBLService();
			   mi=new ManageBLService();
		       pi=new PromotionBLService();
		       pbi=new PurchaseBLService();
		    	si=new Sales();
		    	sii=new SalesLineItem();
		    	ui=new userBLService();
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	    	
		  /* if(System.getSecurityManager()==null)

	              System.setSecurityManager(new RMISecurityManager());
		    try {
			bi = (bookInterface)Naming.lookup(str+"bookInterface");
			mi = (ManageInterface)Naming.lookup(str+" ManageInterface");
			pi = (promotionInterface)Naming.lookup(str+"promotionInterface");
			pbi = (PurchaseBLServiceInterface)Naming.lookup(str+"PurchaseBLServiceInterface");
			si = (SalesInterface)Naming.lookup(str+"SalesInterface");
			sii = (SalesLineItemInterface)Naming.lookup(str+"SalesLineItemInterface");
			ui = (userInterface)Naming.lookup(str+"userInterface");*/
		    	
		    	
		    	

		
	
	   }
	   public bookInterface  getBookInterface(){
		   return bi;
	   }
	   public ManageInterface  getManageInterface(){
		   return mi;
	   } 
	   public promotionInterface  getPromotionInterface(){
		   return pi;
	   }
	   public PurchaseBLServiceInterface getPurchaseBLServiceInterface(){
		   return pbi;
	   }
	
	   public SalesInterface getSalesInterface(){
		   return si;
	   }
	   

	   public SalesLineItemInterface getSalesLineItemInterface(){
		   return sii;
	   }
	   
	   public userInterface getUserInterface(){
		   return ui;
	   }

}
